﻿using System.Collections.Generic;
using System.Web.Mvc;

using System.Collections.Specialized;
using Kaiser.FilterProviders;

namespace Kaiser.Infrastructure
{
    public interface IModule
    {
        /// <summary>
        /// 模块名称
        /// </summary>
        string ModuleName { get; }
        /// <summary>
        /// 认证模块名称
        /// <remarks>通过认证模块(IAuthenticationModule)，可以获取登录、注册和注销页面连接</remarks>
        /// </summary>
        string AuthenticationModuleName { get; }
        /// <summary>
        /// 模块设置
        /// </summary>
        NameValueCollection Settings { get; set; }
        /// <summary>
        /// 初始化模块
        /// </summary>
        void Initialize();
        /// <summary>
        /// 注册路由配置
        /// </summary>
        void RegisterRoutes();
        /// <summary>
        /// 注册过滤器
        /// </summary>
        /// <param name="filterRegistry"></param>
        /// <param name="globalFilters"></param>
        void RegisterFilters(FilterRegistryFilterProvider filterRegistry, GlobalFilterCollection globalFilters);
        /// <summary>
        /// 注册模型绑定器
        /// </summary>
        /// <param name="modelBinders"></param>
        void RegisterModelBinders(ModelBinderDictionary modelBinders);
        /// <summary>
        /// 卸载模块
        /// </summary>
        void Unload();
    }
}
